package com.cn.web;

import com.cn.entity.User;
import com.cn.server.ITestServer;
import org.jrpc.client2.RpcProxy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/8/29.
 */
@RestController
@RequestMapping("test")
public class TestWeb {

    @Autowired
    private ITestServer iTestServer;

    private volatile int ii = 0;

    @RequestMapping("getStr")
    public String getStr() {
        return iTestServer.getStr("我是小明");
    }

    @RequestMapping("getList")
    public List<String> getList() {

        List<String> list = iTestServer.getList("aaaa");
        System.out.println(list);
        List<String> list2 = iTestServer.getList("bbbb");
        List<User> uList = iTestServer.getUser("小明");
        System.out.println(list2);
        System.out.println(uList.size());
        ii++;
//        for(int i=0;i<100;i++){
//            testServer.getList("aaaa");
//            testServer.getUser("小明");
//            ii++;
//        }
        return list;
    }

    @RequestMapping("getInt")
    public Integer getInt() {
        return ii;
    }

    @RequestMapping("moInt")
    public Integer moInt() {
        return ii = 0;
    }
}
